<?php

//     Copyright (c) Microsoft Corporation.  All rights reserved.

/** 
 * This is the main page for the
 * Windows Live Messenger Web Toolkit
 * Getting Started Sample.
 * 
 * EXTENSION LIBRARIES ARE REQUIRED, PLEASE CONFIGURE IN PHP.INI
 * - mhash module
 * - mcrypt module
 */

// Load common settings. For more information, see Settings.php.
include 'lib/settings.php';
include 'lib/windowslivelogin.php';

// Initialize the WindowsLiveLogin module.
$wll = WindowsLiveLogin::initFromXml($KEYFILE);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:msgr="http://messenger.live.com/2009/ui-tags">
<head>
    <title>Get Started with the Windows Live Messenger Web Toolkit</title>

    <script type="text/javascript" src="http://www.wlmessenger.net/api/3.0/loader.js"></script>

    <script type="text/javascript">
        Microsoft.Live.Core.Loader.load(['messenger.ui', 'messenger.ui.styles.core']);    
    </script>
    
    <link type="text/css" rel="stylesheet" href="/themes/higherground/css/layout.css" />
    
    <style type="text/css">
        .content
        {
            margin-left: 10px;
        }
    </style>
</head>
<body>
    <!-- Initialize the application -->
    <msgr:app 
        id="appTag" 
        application-verifier-token="<?php echo $wll->getAppVerifier(); ?>" 
        token-url="refreshmessengertoken.php"
        privacy-url="Privacy.html"
        channel-url="Channel.html">
    </msgr:app>       
    
    <div class="content">
        <h2>Get Started with the Windows Live Messenger Web Toolkit</h2>
        
        <!-- Show display picture -->
        <msgr:if cid="$user" condition="online">
            <msgr:profile cid="$user"></msgr:profile>            
        </msgr:if>

        <!-- Show sign-in control -->
        <msgr:sign-in></msgr:sign-in>
    </div>        
    
    <!-- Show the bar -->
    <msgr:bar></msgr:bar>    
</body>
</html>
